#include<linux/module.h>
#include<linux/sched.h>
#include<linux/pid.h>
#include<asm/thread_info.h>
#include<linux/kthread.h>
MODULE_LICENSE("GPL");
static int __init current_thread_info_init(void)
{
	printk("into current_thread_info_init.\n");
	printk("the current pid is:%d\n",current->pid);
	struct thread_info *info=current_thread_info();
	struct task_struct *task=info->task;
	printk("the pid os the thread is:%d\n",task->pid);
	printk("the tgid of the thread is:%d\n",task->tgid);
	printk("the low level flags is:%u\n",info->flags);
	printk("the thread synchronous flags is:%u\n",info->status);
	printk("current CPU is:%u\n",info->cpu);
	printk("the preempt_count is:%d\n",info->saved_preempt_count);

	printk("out current_thead_info_init.\n");
	return 0;
}
static void __exit current_thread_info_exit(void)
{
	printk("Goodbye current_thread_info\n");
}
module_init(current_thread_info_init);
module_exit(current_thread_info_exit);
